package com.teemor.blog.service.impl;


import com.teemor.blog.bean.condition.TbCommentCondition;
import com.teemor.blog.bean.entity.TbComment;
import com.teemor.blog.mapper.TbCommentMapper;
import com.teemor.blog.service.ICommentService;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author: zhoulk
 * @Description: 原子服务实现
 * @date: 2019/11/26 14:50:14
 */
@Service
public class CommentServiceImpl implements ICommentService {

    @Autowired
    private TbCommentMapper tbCommentMapper;

    @Override
    public int countComment(TbCommentCondition condition) {
        return tbCommentMapper.countCommentByCondition(condition);
    }

    @Override
    public List<TbComment> qryComments(TbCommentCondition condition) {

        return tbCommentMapper.selectCommentByCondition(condition);
    }

    @Override
    public TbComment qryCommentById(Integer commentId) {
        return tbCommentMapper.selectCommentByCommentId(commentId);
    }

    @Override
    public int addComment(TbComment inParam) {
        return tbCommentMapper.insertComment(inParam);
    }

    @Override
    public int updCommentById(TbComment inParam) {
        return tbCommentMapper.updateCommentByCommentId(inParam);
    }
}